#include <stdio.h>   /* Standard input/output definitions */
#include <string.h>  /* String function definitions */
#include <unistd.h>  /* UNIX standard function definitions */
#include <fcntl.h>   /* File control definitions */
#include <errno.h>   /* Error number definitions */
#include <termios.h> /* POSIX terminal control definitions */


int main(int argc, char **argv)
{
	int fd;
	int result;
	char buffer[] = {"123456789abcdefghi\r\n"};

	fd = open("/dev/console", O_RDWR | O_NOCTTY | O_NDELAY);;
	if (fd < 0)
	{
		printf("open /dev/console err!\n");
		return -1;
	}

	while(1)
	{
		result = write(fd, &buffer, strlen(buffer));
		if(result < 0)
			perror("write");
		sleep(1);
	}

	return 0;
}

